﻿using Domain.Entities;
using FrameworkCore.Attributes;
using System.ComponentModel.DataAnnotations;

namespace Application.Features.Groups.DTOs;

#nullable disable

/// <summary>
/// 创建组
/// </summary>
[Map(typeof(Group))]
public class GroupCreateInputModel
{
    /// <summary>
    /// 组名
    /// </summary>
    [Required(ErrorMessage = "名称是必填项")]
    [MaxLength(36, ErrorMessage = "名称长度不能超过36个字符")]
    public string Groupname { get; set; }

    /// <summary>
    /// 编码
    /// </summary>
    [Required(ErrorMessage = "编码是必填项")]
    [MaxLength(36, ErrorMessage = "编码长度不能超过36个字符")]
    public string? Code { get; set; }

    /// <summary>
    /// 是否反面（多用于存在互斥逻辑的情况下）
    /// </summary>
    public bool IsVillain { get; set; }

    /// <summary>
    /// 父级节点
    /// </summary>
    [Range(1, int.MaxValue, ErrorMessage = "父级节点不能为0")]
    public int? ParentId { get; set; }

    /// <summary>
    /// 获取或设置实体的备注
    /// </summary>
    [Required(ErrorMessage = "编码是必填项")]
    [MaxLength(255, ErrorMessage = "备注长度不能超过255个字符")]
    public string? Remark { get; set; }

    /// <summary>
    /// 获取或设置实体的排序值
    /// </summary>
    public int Sort { get; set; } = 0;

    /// <summary>
    /// 启用标识
    /// </summary>
    public bool IsEnabled { get; set; }
}
